home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
PublicDomain
/
Anwendungen
/
DMAmon
/
DMAmon.bas
< prev
next >
Wrap
BASIC Source File
|
1999-03-03
|
2KB
|
86 lines
' DMA Monitor - SNG March 1999, HiSoft BASIC, WB2+
DEFDBL a-z
REM $INCLUDE diskfont.bh
REM $INCLUDE dos.bh
REM $INCLUDE graphics.bh
LIBRARY OPEN "diskfont.library"
LIBRARY OPEN "dos.library"
LIBRARY OPEN "graphics.library"
WINDOW 1," Hisoft BASIC Amiga DMA Monitor", _
(200,16)-(300,80),1+2+4+16+256
' Hardware addresses
CUSTOM& =&HDFF000
DMACONR&=CUSTOM&+2
DSKBYTR&=CUSTOM&+&H1A
REM Use another Compugraphic font if you like
DIM TextAttr%(4)
InitTextAttr TextAttr%(),"Courier.font",15,0,0
font& = OpenDiskFont(VARPTR(TextAttr%(0)))
SetFont WINDOW (8),font&
REPEAT poll
LOCATE 2,1
DMA%=PEEKW(DMACONR&)
' REM Status of the next two does not seem to change
'
' PRINT " Bit Blitter activity ";
' IF (DMA% AND &B0100000000000000)=0
' PRINT "Idle "
' ELSE
' IF (DMA% AND &B0000010000000000)
' PRINT "Active"
' ELSE
' PRINT "Nasty!"
' END IF
' END IF
'
' PRINT " Sprite DMA enabled? ";
' IF (DMA% AND &B0000000000100000)
' PRINT "Active"
' ELSE
' PRINT "Blank "
' END IF
'
PRINT " Sound channel status ";
PRINT RIGHT$("000"+BIN$(DMA% AND &B1111),4)
PRINT " Floppy Disk activity ";
DiskFlags%=PEEKW(DSKBYTR&)
IF (DiskFlags% AND &B0100000000000000)=0
PRINT "Idle "
ELSE
IF (DiskFlags% AND &B0010000000000000)
PRINT "Writing"
ELSE
PRINT "Reading"
END IF
END IF
' IF MOUSE(0) THEN EXIT poll
Delay &20 ' Update 2 or 3 times per second
END REPEAT poll
STOP
' Compugraphc font initialisation, from a HiSoft BASIC example file
SUB InitTextAttr(T%(1),FontName$,BYVAL Height%,BYVAL style%,BYVAL flags%)
POKEL VARPTR(T%(0))+ta_Name%,SADD(FontName$+CHR$(0))
T%(ta_YSize%\2)=Height%
POKEB VARPTR(T%(0))+ta_Style%,style% : POKEB VARPTR(T%(0))+ta_Flags%,flags%
END SUB ' InitTextAttr